import request from '@/utils/request'

//查询知识库资料的列表
export function listKnowBase(query){
  return request({
    url:'/knowledgeBase/list',
    method:'get',
    params: query
  })
}


//查询知识库开放资料的列表
export function listOpenKnowBase(query){
  return request({
    url:'/knowledgeBase/open/list',
    method:'get',
    params: query
  })
}

//查询全部知识库资料的列表
export function allKnowBase(query){
  return request({
    url:'/knowledgeBase/all',
    method:'get',
    params: query
  })
}

//获取单个知识资料的信息
export function getKnowBase(id){
  return request({
    url: '/knowledgeBase/'+id,
    method:'get'
  })
}

//添加知识资料
export function addKnowLeBase(data){
  return request({
    url:'/knowledgeBase',
    method:'post',
    data:data
  })
}

//修改知识资料
export function editKnowLeBase(data){
  return request({
    url:'/knowledgeBase',
    method:'put',
    data:data
  })
}

//假删除知识资料
export function editDelKnowLeBase(id){
  return request({
    url:'/knowledgeBase/'+id,
    method:'put',
  })
}

//删除知识资料
export function delKnowLeBase(id){
  return request({
    url:"/knowledgeBase/"+id,
    method:'delete'
  })
}

export function updateOpenStatus(id){
  return request({
    url:'/knowledgeBase/update/openstatus/'+id,
    method:'get',
  })
}



